<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/view/common/taglibs.jsp"%>
<c:set var="vo" value="${_data}" />
<div class="row">
	<div class="col-xs-12">
		<div class="widget-box">
			<div class="widget-body">
				<div class="widget-main">
					<div class="profile-user-info profile-user-info-striped">
						<input type="hidden" name="quotaId" id="quotaId" value="${vo.id }">
						<input type="hidden" name="id" id="id" value="${vo.confId }">
						<input type="hidden" name="alterTemplate"  id="alterTemplate" value="${vo.alterTemplateSug }">
						<input type="hidden" name ="alterPipelines"  id="alterPipelines"  value="${vo.alterPipeline }">
						<div class="profile-info-row">
							<div class="profile-info-name">监控项</div>
							<div class="profile-info-value">
								<span class="editable"> ${vo.name }&nbsp;</span>
							</div>
						</div>

						<div class="profile-info-row">
							<div class="profile-info-name">告警条件</div>
							<div class="profile-info-value">
								<select id="ruleSn" name="ruleSn" class="input-sm "  onchange="javascript:changerule();">
								<option value="">-请选择-</option>
									<c:forEach var="rule" items="${ruleList}">
										<option value="${rule.sn}"
											<c:if test="${rule.sn==vo.ruleSug}">selected</c:if>>${rule.ruleName}
										</option>
									</c:forEach>
								</select>
							</div>
						</div>
						<div class="profile-info-row">
							<div class="profile-info-name">阈值</div>
							<div class="profile-info-value">
								<input type="text" class="input-sm " value="${vo.value1 }" style="width: 80px;"
									id="value1" name="value1" />
								<label name="val2" style="display: none;">&nbsp;~&nbsp;
										<input type="text" class="input-sm " value="${vo.value2 }" style="width: 80px;"
									id="value2" name="value2" />
								</label>
									&nbsp;&nbsp;建议值：${vo.valueSug1 }
								<label name="val2"  style="display: none;">&nbsp;~&nbsp;${vo.valueSug2 }</label>
							</div>
						</div>
						<div class="profile-info-row">
							<div class="profile-info-name">告警通知规则</div>
							<div class="profile-info-value">
								<div class="control-group">
									<c:forEach var="alertPipeline" items="${alertPipelineEnum}">
										<div class="">
											<label> 
												<input name="alterPipeline" id="alterPipeline_${alertPipeline.code }" type="checkbox"  class="ace" value="${alertPipeline.code }"> 
												<span	class="lbl"> ${alertPipeline.name }</span>
											</label>
										</div>
									</c:forEach>
								</div>
							</div>
						</div>
						<script type="text/javascript">
									var alterPipelines="${vo.alterPipeline }";
									var aps =alterPipelines.split(',');
									for(var i=0;i<aps.length;i++){
										$("#alterPipeline_"+aps[i]).attr("checked", true);
									}
									if(${vo.ruleSug} == 4){
										$("label[name='val2']").css("display","");
									}
					</script>
						<div class="profile-info-row" >
							<div class="profile-info-name">备注</div>
							<div class="profile-info-value ">
								<textarea title="备注" placeholder="请输入备注" class="form-control "
									name="remark" id="remark">${vo.remark }</textarea>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>
</div>
<div class="modal-footer wizard-actions">
	<button class="btn btn-sm btn-info" onclick="javascript:update();"
		data-last="Finish ">
		<i class="icon-ok bigger-110"></i>提交
	</button>
	<button class="btn btn-danger btn-sm pull-left" data-dismiss="modal">
		<i class="icon-remove"></i> 关闭
	</button>
</div>
